\doxysection{utils.\+h}
\hypertarget{utils_8h_source}{}\label{utils_8h_source}\index{C:/Users/ASUS/Desktop/dm-\/ctrlH7-\/balance-\/9025test/Middlewares/ST/ARM/DSP/Include/dsp/utils.h@{C:/Users/ASUS/Desktop/dm-\/ctrlH7-\/balance-\/9025test/Middlewares/ST/ARM/DSP/Include/dsp/utils.h}}

\begin{DoxyCode}{0}
\DoxyCodeLine{00001\ \textcolor{comment}{/******************************************************************************}}
\DoxyCodeLine{00002\ \textcolor{comment}{\ *\ @file\ \ \ \ \ arm\_math\_utils.h}}
\DoxyCodeLine{00003\ \textcolor{comment}{\ *\ @brief\ \ \ \ Public\ header\ file\ for\ CMSIS\ DSP\ Library}}
\DoxyCodeLine{00004\ \textcolor{comment}{\ *\ @version\ \ V1.9.0}}
\DoxyCodeLine{00005\ \textcolor{comment}{\ *\ @date\ \ \ \ \ 20.\ July\ 2020}}
\DoxyCodeLine{00006\ \textcolor{comment}{\ ******************************************************************************/}}
\DoxyCodeLine{00007\ \textcolor{comment}{/*}}
\DoxyCodeLine{00008\ \textcolor{comment}{\ *\ Copyright\ (c)\ 2010-\/2020\ Arm\ Limited\ or\ its\ affiliates.\ All\ rights\ reserved.}}
\DoxyCodeLine{00009\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00010\ \textcolor{comment}{\ *\ SPDX-\/License-\/Identifier:\ Apache-\/2.0}}
\DoxyCodeLine{00011\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00012\ \textcolor{comment}{\ *\ Licensed\ under\ the\ Apache\ License,\ Version\ 2.0\ (the\ License);\ you\ may}}
\DoxyCodeLine{00013\ \textcolor{comment}{\ *\ not\ use\ this\ file\ except\ in\ compliance\ with\ the\ License.}}
\DoxyCodeLine{00014\ \textcolor{comment}{\ *\ You\ may\ obtain\ a\ copy\ of\ the\ License\ at}}
\DoxyCodeLine{00015\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00016\ \textcolor{comment}{\ *\ www.apache.org/licenses/LICENSE-\/2.0}}
\DoxyCodeLine{00017\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00018\ \textcolor{comment}{\ *\ Unless\ required\ by\ applicable\ law\ or\ agreed\ to\ in\ writing,\ software}}
\DoxyCodeLine{00019\ \textcolor{comment}{\ *\ distributed\ under\ the\ License\ is\ distributed\ on\ an\ AS\ IS\ BASIS,\ WITHOUT}}
\DoxyCodeLine{00020\ \textcolor{comment}{\ *\ WARRANTIES\ OR\ CONDITIONS\ OF\ ANY\ KIND,\ either\ express\ or\ implied.}}
\DoxyCodeLine{00021\ \textcolor{comment}{\ *\ See\ the\ License\ for\ the\ specific\ language\ governing\ permissions\ and}}
\DoxyCodeLine{00022\ \textcolor{comment}{\ *\ limitations\ under\ the\ License.}}
\DoxyCodeLine{00023\ \textcolor{comment}{\ */}}
\DoxyCodeLine{00024\ }
\DoxyCodeLine{00025\ \textcolor{preprocessor}{\#ifndef\ \_ARM\_MATH\_UTILS\_H\_}}
\DoxyCodeLine{00026\ }
\DoxyCodeLine{00027\ \textcolor{preprocessor}{\#define\ \_ARM\_MATH\_UTILS\_H\_}}
\DoxyCodeLine{00028\ }
\DoxyCodeLine{00029\ \textcolor{preprocessor}{\#include\ "{}arm\_math\_types.h"{}}}
\DoxyCodeLine{00030\ \textcolor{preprocessor}{\#include\ <limits.h>}}
\DoxyCodeLine{00031\ }
\DoxyCodeLine{00032\ \textcolor{preprocessor}{\#ifdef\ \ \ \_\_cplusplus}}
\DoxyCodeLine{00033\ \textcolor{keyword}{extern}\ \textcolor{stringliteral}{"{}C"{}}}
\DoxyCodeLine{00034\ \{}
\DoxyCodeLine{00035\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{00036\ }
\DoxyCodeLine{00040\ }
\DoxyCodeLine{00041\ \textcolor{preprocessor}{\#define\ INDEX\_MASK\ \ \ \ \ \ \ \ \ 0x0000003F}}
\DoxyCodeLine{00042\ }
\DoxyCodeLine{00043\ \textcolor{preprocessor}{\#ifndef\ MIN}}
\DoxyCodeLine{00044\ \textcolor{preprocessor}{\ \ \#define\ MIN(x,y)\ ((x)\ <\ (y)\ ?\ (x)\ :\ (y))}}
\DoxyCodeLine{00045\ \textcolor{preprocessor}{\#endif\ }}
\DoxyCodeLine{00046\ }
\DoxyCodeLine{00047\ \textcolor{preprocessor}{\#ifndef\ MAX}}
\DoxyCodeLine{00048\ \textcolor{preprocessor}{\ \ \#define\ MAX(x,y)\ ((x)\ >\ (y)\ ?\ (x)\ :\ (y))}}
\DoxyCodeLine{00049\ \textcolor{preprocessor}{\#endif\ }}
\DoxyCodeLine{00050\ }
\DoxyCodeLine{00051\ \textcolor{preprocessor}{\#define\ SQ(x)\ ((x)\ *\ (x))}}
\DoxyCodeLine{00052\ }
\DoxyCodeLine{00053\ \textcolor{preprocessor}{\#define\ ROUND\_UP(N,\ S)\ ((((N)\ +\ (S)\ -\/\ 1)\ /\ (S))\ *\ (S))}}
\DoxyCodeLine{00054\ }
\DoxyCodeLine{00055\ }
\DoxyCodeLine{00060\ \ \ \_\_STATIC\_FORCEINLINE\ uint32\_t\ arm\_recip\_q31(}
\DoxyCodeLine{00061\ \ \ \ \ \ \ \ \ q31\_t\ in,}
\DoxyCodeLine{00062\ \ \ \ \ \ \ \ \ q31\_t\ *\ dst,}
\DoxyCodeLine{00063\ \ \ \textcolor{keyword}{const}\ q31\_t\ *\ pRecipTable)}
\DoxyCodeLine{00064\ \ \ \{}
\DoxyCodeLine{00065\ \ \ \ \ q31\_t\ out;}
\DoxyCodeLine{00066\ \ \ \ \ uint32\_t\ tempVal;}
\DoxyCodeLine{00067\ \ \ \ \ uint32\_t\ index,\ i;}
\DoxyCodeLine{00068\ \ \ \ \ uint32\_t\ signBits;}
\DoxyCodeLine{00069\ }
\DoxyCodeLine{00070\ \ \ \ \ \textcolor{keywordflow}{if}\ (in\ >\ 0)}
\DoxyCodeLine{00071\ \ \ \ \ \{}
\DoxyCodeLine{00072\ \ \ \ \ \ \ signBits\ =\ ((uint32\_t)\ (\mbox{\hyperlink{group___c_m_s_i_s___core___instruction_interface_ga5d5bb1527e042be4a9fa5a33f65cc248}{\_\_CLZ}}(\ (uint32\_t)in)\ -\/\ 1));}
\DoxyCodeLine{00073\ \ \ \ \ \}}
\DoxyCodeLine{00074\ \ \ \ \ \textcolor{keywordflow}{else}}
\DoxyCodeLine{00075\ \ \ \ \ \{}
\DoxyCodeLine{00076\ \ \ \ \ \ \ signBits\ =\ ((uint32\_t)\ (\mbox{\hyperlink{group___c_m_s_i_s___core___instruction_interface_ga5d5bb1527e042be4a9fa5a33f65cc248}{\_\_CLZ}}((uint32\_t)(-\/in))\ -\/\ 1));}
\DoxyCodeLine{00077\ \ \ \ \ \}}
\DoxyCodeLine{00078\ }
\DoxyCodeLine{00079\ \ \ \ \ \textcolor{comment}{/*\ Convert\ input\ sample\ to\ 1.31\ format\ */}}
\DoxyCodeLine{00080\ \ \ \ \ in\ =\ (in\ <<\ signBits);}
\DoxyCodeLine{00081\ }
\DoxyCodeLine{00082\ \ \ \ \ \textcolor{comment}{/*\ calculation\ of\ index\ for\ initial\ approximated\ Val\ */}}
\DoxyCodeLine{00083\ \ \ \ \ index\ =\ (uint32\_t)(in\ >>\ 24);}
\DoxyCodeLine{00084\ \ \ \ \ index\ =\ (index\ \&\ INDEX\_MASK);}
\DoxyCodeLine{00085\ }
\DoxyCodeLine{00086\ \ \ \ \ \textcolor{comment}{/*\ 1.31\ with\ exp\ 1\ */}}
\DoxyCodeLine{00087\ \ \ \ \ out\ =\ pRecipTable[index];}
\DoxyCodeLine{00088\ }
\DoxyCodeLine{00089\ \ \ \ \ \textcolor{comment}{/*\ calculation\ of\ reciprocal\ value\ */}}
\DoxyCodeLine{00090\ \ \ \ \ \textcolor{comment}{/*\ running\ approximation\ for\ two\ iterations\ */}}
\DoxyCodeLine{00091\ \ \ \ \ \textcolor{keywordflow}{for}\ (i\ =\ 0U;\ i\ <\ 2U;\ i++)}
\DoxyCodeLine{00092\ \ \ \ \ \{}
\DoxyCodeLine{00093\ \ \ \ \ \ \ tempVal\ =\ (uint32\_t)\ (((q63\_t)\ in\ *\ out)\ >>\ 31);}
\DoxyCodeLine{00094\ \ \ \ \ \ \ tempVal\ =\ 0x7FFFFFFFu\ -\/\ tempVal;}
\DoxyCodeLine{00095\ \ \ \ \ \ \ \textcolor{comment}{/*\ \ \ \ \ \ 1.31\ with\ exp\ 1\ */}}
\DoxyCodeLine{00096\ \ \ \ \ \ \ \textcolor{comment}{/*\ out\ =\ (q31\_t)\ (((q63\_t)\ out\ *\ tempVal)\ >>\ 30);\ */}}
\DoxyCodeLine{00097\ \ \ \ \ \ \ out\ =\ clip\_q63\_to\_q31(((q63\_t)\ out\ *\ tempVal)\ >>\ 30);}
\DoxyCodeLine{00098\ \ \ \ \ \}}
\DoxyCodeLine{00099\ }
\DoxyCodeLine{00100\ \ \ \ \ \textcolor{comment}{/*\ write\ output\ */}}
\DoxyCodeLine{00101\ \ \ \ \ *dst\ =\ out;}
\DoxyCodeLine{00102\ }
\DoxyCodeLine{00103\ \ \ \ \ \textcolor{comment}{/*\ return\ num\ of\ signbits\ of\ out\ =\ 1/in\ value\ */}}
\DoxyCodeLine{00104\ \ \ \ \ \textcolor{keywordflow}{return}\ (signBits\ +\ 1U);}
\DoxyCodeLine{00105\ \ \ \}}
\DoxyCodeLine{00106\ }
\DoxyCodeLine{00107\ }
\DoxyCodeLine{00112\ \ \ \_\_STATIC\_FORCEINLINE\ uint32\_t\ arm\_recip\_q15(}
\DoxyCodeLine{00113\ \ \ \ \ \ \ \ \ q15\_t\ in,}
\DoxyCodeLine{00114\ \ \ \ \ \ \ \ \ q15\_t\ *\ dst,}
\DoxyCodeLine{00115\ \ \ \textcolor{keyword}{const}\ q15\_t\ *\ pRecipTable)}
\DoxyCodeLine{00116\ \ \ \{}
\DoxyCodeLine{00117\ \ \ \ \ q15\_t\ out\ =\ 0;}
\DoxyCodeLine{00118\ \ \ \ \ int32\_t\ tempVal\ =\ 0;}
\DoxyCodeLine{00119\ \ \ \ \ uint32\_t\ index\ =\ 0,\ i\ =\ 0;}
\DoxyCodeLine{00120\ \ \ \ \ uint32\_t\ signBits\ =\ 0;}
\DoxyCodeLine{00121\ }
\DoxyCodeLine{00122\ \ \ \ \ \textcolor{keywordflow}{if}\ (in\ >\ 0)}
\DoxyCodeLine{00123\ \ \ \ \ \{}
\DoxyCodeLine{00124\ \ \ \ \ \ \ signBits\ =\ ((uint32\_t)(\mbox{\hyperlink{group___c_m_s_i_s___core___instruction_interface_ga5d5bb1527e042be4a9fa5a33f65cc248}{\_\_CLZ}}(\ (uint32\_t)in)\ -\/\ 17));}
\DoxyCodeLine{00125\ \ \ \ \ \}}
\DoxyCodeLine{00126\ \ \ \ \ \textcolor{keywordflow}{else}}
\DoxyCodeLine{00127\ \ \ \ \ \{}
\DoxyCodeLine{00128\ \ \ \ \ \ \ signBits\ =\ ((uint32\_t)(\mbox{\hyperlink{group___c_m_s_i_s___core___instruction_interface_ga5d5bb1527e042be4a9fa5a33f65cc248}{\_\_CLZ}}((uint32\_t)(-\/in))\ -\/\ 17));}
\DoxyCodeLine{00129\ \ \ \ \ \}}
\DoxyCodeLine{00130\ }
\DoxyCodeLine{00131\ \ \ \ \ \textcolor{comment}{/*\ Convert\ input\ sample\ to\ 1.15\ format\ */}}
\DoxyCodeLine{00132\ \ \ \ \ in\ =\ (q15\_t)(in\ <<\ signBits);}
\DoxyCodeLine{00133\ }
\DoxyCodeLine{00134\ \ \ \ \ \textcolor{comment}{/*\ calculation\ of\ index\ for\ initial\ approximated\ Val\ */}}
\DoxyCodeLine{00135\ \ \ \ \ index\ =\ (uint32\_t)(in\ >>\ \ 8);}
\DoxyCodeLine{00136\ \ \ \ \ index\ =\ (index\ \&\ INDEX\_MASK);}
\DoxyCodeLine{00137\ }
\DoxyCodeLine{00138\ \ \ \ \ \textcolor{comment}{/*\ \ \ \ \ \ 1.15\ with\ exp\ 1\ \ */}}
\DoxyCodeLine{00139\ \ \ \ \ out\ =\ pRecipTable[index];}
\DoxyCodeLine{00140\ }
\DoxyCodeLine{00141\ \ \ \ \ \textcolor{comment}{/*\ calculation\ of\ reciprocal\ value\ */}}
\DoxyCodeLine{00142\ \ \ \ \ \textcolor{comment}{/*\ running\ approximation\ for\ two\ iterations\ */}}
\DoxyCodeLine{00143\ \ \ \ \ \textcolor{keywordflow}{for}\ (i\ =\ 0U;\ i\ <\ 2U;\ i++)}
\DoxyCodeLine{00144\ \ \ \ \ \{}
\DoxyCodeLine{00145\ \ \ \ \ \ \ tempVal\ =\ (((q31\_t)\ in\ *\ out)\ >>\ 15);}
\DoxyCodeLine{00146\ \ \ \ \ \ \ tempVal\ =\ 0x7FFF\ -\/\ tempVal;}
\DoxyCodeLine{00147\ \ \ \ \ \ \ \textcolor{comment}{/*\ \ \ \ \ \ 1.15\ with\ exp\ 1\ */}}
\DoxyCodeLine{00148\ \ \ \ \ \ \ out\ =\ (q15\_t)\ (((q31\_t)\ out\ *\ tempVal)\ >>\ 14);}
\DoxyCodeLine{00149\ \ \ \ \ \ \ \textcolor{comment}{/*\ out\ =\ clip\_q31\_to\_q15(((q31\_t)\ out\ *\ tempVal)\ >>\ 14);\ */}}
\DoxyCodeLine{00150\ \ \ \ \ \}}
\DoxyCodeLine{00151\ }
\DoxyCodeLine{00152\ \ \ \ \ \textcolor{comment}{/*\ write\ output\ */}}
\DoxyCodeLine{00153\ \ \ \ \ *dst\ =\ out;}
\DoxyCodeLine{00154\ }
\DoxyCodeLine{00155\ \ \ \ \ \textcolor{comment}{/*\ return\ num\ of\ signbits\ of\ out\ =\ 1/in\ value\ */}}
\DoxyCodeLine{00156\ \ \ \ \ \textcolor{keywordflow}{return}\ (signBits\ +\ 1);}
\DoxyCodeLine{00157\ \ \ \}}
\DoxyCodeLine{00158\ }
\DoxyCodeLine{00159\ }
\DoxyCodeLine{00166\ \_\_STATIC\_INLINE\ \ \textcolor{keywordtype}{void}\ arm\_norm\_64\_to\_32u(uint64\_t\ in,\ int32\_t\ *\ normalized,\ int32\_t\ *norm)}
\DoxyCodeLine{00167\ \{}
\DoxyCodeLine{00168\ \ \ \ \ int32\_t\ \ \ \ \ n1;}
\DoxyCodeLine{00169\ \ \ \ \ int32\_t\ \ \ \ \ hi\ =\ (int32\_t)\ (in\ >>\ 32);}
\DoxyCodeLine{00170\ \ \ \ \ int32\_t\ \ \ \ \ lo\ =\ (int32\_t)\ ((in\ <<\ 32)\ >>\ 32);}
\DoxyCodeLine{00171\ }
\DoxyCodeLine{00172\ \ \ \ \ n1\ =\ \mbox{\hyperlink{group___c_m_s_i_s___core___instruction_interface_ga5d5bb1527e042be4a9fa5a33f65cc248}{\_\_CLZ}}((uint32\_t)hi)\ -\/\ 32;}
\DoxyCodeLine{00173\ \ \ \ \ \textcolor{keywordflow}{if}\ (!n1)}
\DoxyCodeLine{00174\ \ \ \ \ \{}
\DoxyCodeLine{00175\ \ \ \ \ \ \ \ \ \textcolor{comment}{/*}}
\DoxyCodeLine{00176\ \textcolor{comment}{\ \ \ \ \ \ \ \ \ *\ input\ fits\ in\ 32-\/bit}}
\DoxyCodeLine{00177\ \textcolor{comment}{\ \ \ \ \ \ \ \ \ */}}
\DoxyCodeLine{00178\ \ \ \ \ \ \ \ \ n1\ =\ \mbox{\hyperlink{group___c_m_s_i_s___core___instruction_interface_ga5d5bb1527e042be4a9fa5a33f65cc248}{\_\_CLZ}}((uint32\_t)lo);}
\DoxyCodeLine{00179\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!n1)}
\DoxyCodeLine{00180\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{00181\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{/*}}
\DoxyCodeLine{00182\ \textcolor{comment}{\ \ \ \ \ \ \ \ \ \ \ \ \ *\ MSB\ set,\ need\ to\ scale\ down\ by\ 1}}
\DoxyCodeLine{00183\ \textcolor{comment}{\ \ \ \ \ \ \ \ \ \ \ \ \ */}}
\DoxyCodeLine{00184\ \ \ \ \ \ \ \ \ \ \ \ \ *norm\ =\ -\/1;}
\DoxyCodeLine{00185\ \ \ \ \ \ \ \ \ \ \ \ \ *normalized\ =\ (((uint32\_t)\ lo)\ >>\ 1);}
\DoxyCodeLine{00186\ \ \ \ \ \ \ \ \ \}\ \textcolor{keywordflow}{else}}
\DoxyCodeLine{00187\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{00188\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (n1\ ==\ 32)}
\DoxyCodeLine{00189\ \ \ \ \ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{00190\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{/*}}
\DoxyCodeLine{00191\ \textcolor{comment}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ *\ input\ is\ zero}}
\DoxyCodeLine{00192\ \textcolor{comment}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ */}}
\DoxyCodeLine{00193\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ *norm\ =\ 0;}
\DoxyCodeLine{00194\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ *normalized\ =\ 0;}
\DoxyCodeLine{00195\ \ \ \ \ \ \ \ \ \ \ \ \ \}\ \textcolor{keywordflow}{else}}
\DoxyCodeLine{00196\ \ \ \ \ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{00197\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{/*}}
\DoxyCodeLine{00198\ \textcolor{comment}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ *\ 32-\/bit\ normalization}}
\DoxyCodeLine{00199\ \textcolor{comment}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ */}}
\DoxyCodeLine{00200\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ *norm\ =\ n1\ -\/\ 1;}
\DoxyCodeLine{00201\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ *normalized\ =\ lo\ <<\ *norm;}
\DoxyCodeLine{00202\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00203\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00204\ \ \ \ \ \}\ \textcolor{keywordflow}{else}}
\DoxyCodeLine{00205\ \ \ \ \ \{}
\DoxyCodeLine{00206\ \ \ \ \ \ \ \ \ \textcolor{comment}{/*}}
\DoxyCodeLine{00207\ \textcolor{comment}{\ \ \ \ \ \ \ \ \ *\ input\ fits\ in\ 64-\/bit}}
\DoxyCodeLine{00208\ \textcolor{comment}{\ \ \ \ \ \ \ \ \ */}}
\DoxyCodeLine{00209\ \ \ \ \ \ \ \ \ n1\ =\ 1\ -\/\ n1;}
\DoxyCodeLine{00210\ \ \ \ \ \ \ \ \ *norm\ =\ -\/n1;}
\DoxyCodeLine{00211\ \ \ \ \ \ \ \ \ \textcolor{comment}{/*}}
\DoxyCodeLine{00212\ \textcolor{comment}{\ \ \ \ \ \ \ \ \ *\ 64\ bit\ normalization}}
\DoxyCodeLine{00213\ \textcolor{comment}{\ \ \ \ \ \ \ \ \ */}}
\DoxyCodeLine{00214\ \ \ \ \ \ \ \ \ *normalized\ =\ (int32\_t)(((uint32\_t)lo)\ >>\ n1)\ |\ (hi\ <<\ (32\ -\/\ n1));}
\DoxyCodeLine{00215\ \ \ \ \ \}}
\DoxyCodeLine{00216\ \}}
\DoxyCodeLine{00217\ }
\DoxyCodeLine{00218\ \_\_STATIC\_INLINE\ int32\_t\ arm\_div\_int64\_to\_int32(int64\_t\ num,\ int32\_t\ den)}
\DoxyCodeLine{00219\ \{}
\DoxyCodeLine{00220\ \ \ \ \ int32\_t\ \ \ result;}
\DoxyCodeLine{00221\ \ \ \ \ uint64\_t\ \ \ absNum;}
\DoxyCodeLine{00222\ \ \ \ \ int32\_t\ \ \ normalized;}
\DoxyCodeLine{00223\ \ \ \ \ int32\_t\ \ \ norm;}
\DoxyCodeLine{00224\ }
\DoxyCodeLine{00225\ \ \ \ \ \textcolor{comment}{/*}}
\DoxyCodeLine{00226\ \textcolor{comment}{\ \ \ \ \ *\ if\ sum\ fits\ in\ 32bits}}
\DoxyCodeLine{00227\ \textcolor{comment}{\ \ \ \ \ *\ avoid\ costly\ 64-\/bit\ division}}
\DoxyCodeLine{00228\ \textcolor{comment}{\ \ \ \ \ */}}
\DoxyCodeLine{00229\ \ \ \ \ \textcolor{keywordflow}{if}\ (num\ ==\ (int64\_t)LONG\_MIN)}
\DoxyCodeLine{00230\ \ \ \ \ \{}
\DoxyCodeLine{00231\ \ \ \ \ \ \ \ \ absNum\ =\ LONG\_MAX;}
\DoxyCodeLine{00232\ \ \ \ \ \}}
\DoxyCodeLine{00233\ \ \ \ \ \textcolor{keywordflow}{else}}
\DoxyCodeLine{00234\ \ \ \ \ \{}
\DoxyCodeLine{00235\ \ \ \ \ \ \ \ absNum\ =\ (uint64\_t)\ (num\ >\ 0\ ?\ num\ :\ -\/num);}
\DoxyCodeLine{00236\ \ \ \ \ \}}
\DoxyCodeLine{00237\ \ \ \ \ arm\_norm\_64\_to\_32u(absNum,\ \&normalized,\ \&norm);}
\DoxyCodeLine{00238\ \ \ \ \ \textcolor{keywordflow}{if}\ (norm\ >\ 0)}
\DoxyCodeLine{00239\ \ \ \ \ \ \ \ \ \textcolor{comment}{/*}}
\DoxyCodeLine{00240\ \textcolor{comment}{\ \ \ \ \ \ \ \ \ *\ 32-\/bit\ division}}
\DoxyCodeLine{00241\ \textcolor{comment}{\ \ \ \ \ \ \ \ \ */}}
\DoxyCodeLine{00242\ \ \ \ \ \ \ \ \ result\ =\ (int32\_t)\ num\ /\ den;}
\DoxyCodeLine{00243\ \ \ \ \ \textcolor{keywordflow}{else}}
\DoxyCodeLine{00244\ \ \ \ \ \ \ \ \ \textcolor{comment}{/*}}
\DoxyCodeLine{00245\ \textcolor{comment}{\ \ \ \ \ \ \ \ \ *\ 64-\/bit\ division}}
\DoxyCodeLine{00246\ \textcolor{comment}{\ \ \ \ \ \ \ \ \ */}}
\DoxyCodeLine{00247\ \ \ \ \ \ \ \ \ result\ =\ (int32\_t)\ (num\ /\ den);}
\DoxyCodeLine{00248\ }
\DoxyCodeLine{00249\ \ \ \ \ \textcolor{keywordflow}{return}\ result;}
\DoxyCodeLine{00250\ \}}
\DoxyCodeLine{00251\ }
\DoxyCodeLine{00252\ }
\DoxyCodeLine{00253\ \textcolor{preprocessor}{\#ifdef\ \ \ \_\_cplusplus}}
\DoxyCodeLine{00254\ \}}
\DoxyCodeLine{00255\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{00256\ }
\DoxyCodeLine{00257\ \textcolor{preprocessor}{\#endif\ }\textcolor{comment}{/*ifndef\ \_ARM\_MATH\_UTILS\_H\_\ */}\textcolor{preprocessor}{}}

\end{DoxyCode}
